package com.origin.learn.es.util;

import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.index.query.RangeQueryBuilder;
import org.elasticsearch.search.aggregations.AggregationBuilder;
import org.elasticsearch.search.aggregations.AggregationBuilders;

/**
 * @Description: Elasticsearch常用操作
 * @Date: 2020/2/24
 * @Time: 19:29
 * @Created by:   dingtao
 * @Modified by:
 * @Modified at:
 */
public interface Operations {
    default Object countQuery(String index, String var2){
        AggregationBuilder aggregationBuilder = AggregationBuilders.count("ageCount").field("age");
        RangeQueryBuilder ramgeQueryBuilder = QueryBuilders.rangeQuery("age").from(30, true)
                .to(30, true);
        return null;
    }

}
